package cn.iocoder.yudao.module.vote.constants;

import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;

/**
 * @author guomoving
 * @description
 * @date
 */
public class Const {

    /**
     * 生成二维码连接参数
     */
    public static final String VOTE_QRCODE_PARAMS = "voteId={}&votePersonType={}";

    /**
     * 生成二维码连接
     */
    public static final String VOTE_QRCODE_URL = "http://59.50.66.62:8081/voteisti/votes?data={}";

    /**
     * 二维码宽
     */
    public static final Integer QRCODE_WIDTH = 600;
    /**
     * 二维码高
     */
    public static final Integer QRCODE_HEIGHT = 600;

    /**
     * 优秀
     */
    public static final int EXCELLENT = 1;
    /**
     * 合格
     */
    public static final int QUALIFIED =2;
    /**
     * 基本合格
     */
    public static final int BASEQUALIFIED =3;
    /**
     * 不合格
     */
    public static final int UNQUALIFIED =4;
    /**
     * 弃权
     */
    public static final int WAIVER =5;


    public static final Table<String, Double, Double> SCOPETYPE = HashBasedTable.create();

    static {
        // 存储数据
        SCOPETYPE.put("keyTasks", 40D, 1D);
        SCOPETYPE.put("keyTasks", 30D, 0.75);
        SCOPETYPE.put("keyTasks", 20D, 0.5);
        SCOPETYPE.put("keyTasks", 10D, 0.1);
        SCOPETYPE.put("keyTasks", 0D,0D);

        SCOPETYPE.put("progress", 40D, 1D);
        SCOPETYPE.put("progress", 30D, 0.75);
        SCOPETYPE.put("progress", 20D, 0.5);
        SCOPETYPE.put("progress", 10D, 0.1);
        SCOPETYPE.put("progress", 0D,0D);

        SCOPETYPE.put("collaboration", 10D, 1D);
        SCOPETYPE.put("collaboration", 7.5D,0.75);
        SCOPETYPE.put("collaboration", 5D, 0.5);
        SCOPETYPE.put("collaboration", 2.5D,0.1);
        SCOPETYPE.put("collaboration", 0D,0D);

        SCOPETYPE.put("teamBuilding", 10D, 1D);
        SCOPETYPE.put("teamBuilding", 7.5D,0.75);
        SCOPETYPE.put("teamBuilding", 5D, 0.5);
        SCOPETYPE.put("teamBuilding", 2.5D,0.1);
        SCOPETYPE.put("teamBuilding", 0D,0D);
    }


    public static Double getScopeTypeWeight(String key,Double field){
        Double result = SCOPETYPE.get(key,field);
        if(result==null){
            return 0D;
        }
        return result;
    }

}
